import Index from '@/pages/index.vue'
import CardView from '@/pages/admin/views/card.vue'
import LearningPage from '@/pages/admin/views/LearningPage.vue'
import StudyDetailPage from '@/pages/admin/views/StudyDetailPage.vue'
import MarkdownEditor from '@/pages/admin/views/MarkdownEditor.vue'
import DocumentParser from '@/pages/admin/DocumentParser.vue'
import KnowledgeIndex from '@/pages/admin/knowledge/index.vue'
import { createRouter, createWebHashHistory } from 'vue-router'

// 统一在这里声明所有路由
const routes = [
    {
        path: '/', // 路由地址，首页
        component: Index, // 对应组件
        meta: { // meta 信息
            title: 'Weblog 首页' // 页面标题
        }
    },
    {
        path: '/document-parser', // 文档解析页面
        component: DocumentParser,
        meta: {
            title: '文档解析'
        }
    },
    {
        path: '/knowledge', // 知识图谱页面
        component: KnowledgeIndex,
        meta: {
            title: '知识图谱'
        }
    }
]

// 创建路由
const router = createRouter({
    // 指定路由的历史管理方式，hash 模式指的是 URL 的路径是通过 hash 符号（#）进行标识
    history: createWebHashHistory(),
    // routes: routes 的缩写
    routes, 
})

// 暴露出去
export default router

